﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.YWDF
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.YWDF;

    public class ywdf_room_Map : ClassMapping<ywdf_room>
    {
        public ywdf_room_Map()
        {
            Id(x => x.id, map =>
            {
                map.Length(40);
                map.Column(ywdf_room.Columns.id);
            });
            Property(x => x.is_valid, map => map.Column(ywdf_room.Columns.is_valid));
            Property(x => x.create_date, map => map.Column(ywdf_room.Columns.create_date));

            Property(x => x.room_describe, map => map.Length(10000));

            Property(x => x.room_name, map => map.Length(1000));

            Property(x => x.room_price, map => map.Length(50));

            Property(x => x.order_flag);

            //关联所属酒店
            ManyToOne(x => x.hotel, map =>
            {
                map.Column(ywdf_room.Columns.hotel_id);
            });

            Table(ywdf_room.TableName);

            //不进行创建
            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
